#ifndef __USART_H__
#define __USART_H__
#include <main.h>

#define USART_CACHE_LEN			512
typedef struct {
    uint8_t data[USART_CACHE_LEN];
    uint16_t cnt;
} usart_cache;
extern usart_cache usart1_cache;
extern usart_cache usart2_cache;
extern usart_cache usart3_cache;
extern usart_cache usart4_cache;
extern usart_cache usart5_cache;
extern usart_cache usart6_cache;
extern usart_cache usart7_cache;

typedef enum {
    BACKUP_485 = 2,
    CNN_485 = 3,
} Type485;

void usart1_init(void);
void usart2_init(void);
void usart3_init(void);
void usart4_init(void);
void usart5_init(void);
void usart6_init(void);
void usart7_init(void);
uint8_t usart_trans(USART_Module* USARTx, uint8_t* Data, uint16_t DataLen);
uint8_t usart_485initial(Type485 Name485);
uint8_t usart_485trans(Type485 Name485, uint8_t* Data, uint16_t DataLen);

#endif

